< previous page page_139 next page >

Page 139
12180-0139a.gif
Figure 6.7.
The Add Module dialog box.
12180-0139b.gif
Figure 6.8.
The Add Procedure dialog
box.
At this point, you need to add a test project to properly test the behavior of your component. You could conceivably create an ActiveX DLL without a test project, but it would be beneficial to read the next sections about testing components.
Test Planning for ActiveX Components
When you create an ActiveX component in Visual Basic, you have flexibility in testing it. That is, you can use debugging features such as Break in Class Module or Break on All Errors. Further, you can specify which errors to break by pressing Alt+F8. This combination enables you to skip to your error-handling mechanism when you've reached your desired error and/or raise that error for an external method (of the client object) to handle. Pressing Alt+F5 invokes your error-handling mechanism as well.
Testing any component requires a plan with clear goals. These goals reflect the type of application(s) in which the component is being deployed. Test planning for components takes into account that
Components should be reusable.
Components are loosely coupled with other components and applications.
Reusability and loose coupling are satisfied through a well-designed public interface or set of public interfaces. Testing the internal operations of a component requires the usual

 
< previous page page_139 next page >

If you like this book, buy it!